# -*- coding: utf-8 -*-
import json
import pandas as pd

def analysis(file, user_id):
    times = 0
    minutes = 0
    data = pd.read_json(file,orient='records',encoding='utf-8')
    times = data[data['user_id']==user_id]['minutes'].count()
    minutes = data[data['user_id']==user_id]['minutes'].sum()
    return times, minutes


if __name__=='__main__':
    print(analysis('user_study.json',5348))
